package com.gy.sb.sbslavedatasource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.gy.sb.sbslavedatasource.dao.Slave1Mapper;
import com.gy.sb.sbslavedatasource.entity.Slave1;

@RestController
public class SlaveTestController {

    @Autowired
    private Slave1Mapper slave1Mapper;

    @GetMapping("/get/user/{id}")
    public Slave1 getSlave(@PathVariable("id") Integer id) {
        System.out.println(id);
        Slave1 byId = slave1Mapper.getById(id);
        System.out.println(byId);
        return byId;
    }

}
